namespace Expect.Documentation.Advanced_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Changing the container base class", Path="\\Advanced concepts\\Changing the container base class.expect")]
    public partial class ChangingTheContainerBaseClassContainer : Expect.Documentation.Advanced_concepts.CustomContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Changing the container base class.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void ChangingTheContainerBaseClassClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void ChangingTheContainerBaseClassClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void ChangingTheContainerBaseClass()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_ChangingTheContainerBaseClass(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Changing the container base class")]
        public virtual void Get_ChangingTheContainerBaseClass(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Changing the container base class";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 3
            fixture.WithRow("You could define what container base class is used in your specification. One goa" +
                    "l could be to share some technical context initialization or finalization, betwe" +
                    "en multiple specifications.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 5
            fixture.WithRow("There is actually to way to change the default container class.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 7
            fixture.WithRow("The first way is to add a containerbase bloc in your specification file. This blo" +
                    "c looks like this :");
#line 8
            fixture.WithRow("{{");
#line 9
            fixture.WithRow("@containerbase Expect.Documentation.Advanced_concepts.CustomContainer");
#line 10
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 12
            fixture.WithRow("!for example!:");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 13
            fixture.WithRow("This specification use a different container base class");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 15
            fixture.WithRow("You could define fixture in a container base class and use them in all derived sp" +
                    "ecification, for example");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 16
            fixture.WithRow("This is a fixture defined in the container base class");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 18
            fixture.WithRow("The other way is define a default container class in the configuration file. In t" +
                    "his case, this default class apply to all specifications.");
#line 19
            fixture.WithRow("!A sample configuration! :");
#line 20
            fixture.WithRow("{{");
#line 21
            fixture.WithRow("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
#line 22
            fixture.WithRow("<configuration>");
#line 23
            fixture.WithRow("  <configSections>");
#line 24
            fixture.WithRow("    <section name=\"expect\" type=\"Expect.Core.ExpectConfigurationSection, Expect.C" +
                    "ore\"/>");
#line 25
            fixture.WithRow("    <section name=\"expect.watin\" type=\"Expect.WatiN.ExpectWatiNSection, Expect.Wa" +
                    "tiN\"/>");
#line 26
            fixture.WithRow("  </configSections>");
#line 27
            fixture.WithRow("  <expect>");
#line 28
            fixture.WithRow("    <codegen unitTestProvider=\"MsTest\" containerbaseclass=\"Expect.Documentation.A" +
                    "dvanced_concepts.CustomContainer\" />    ");
#line 29
            fixture.WithRow("  </expect>");
#line 30
            fixture.WithRow("</configuration>");
#line 31
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 33
            fixture.WithRow("Note that if you change the default container class in the configuration and you " +
                    "have existing specifications, you will have to regenerate the specification clas" +
                    "s by running the custom tool.");
#line 34
            fixture.WithRow("To do this, you could simply right click a \".expect\" specification file, and sele" +
                    "ct \"Run custom tool\".");
#line hidden
            fixture.EndRun();

        }
    }
}
